﻿Imports System.Windows.Forms

Public Class ScenarioFolderDialog

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub ScenarioFolderDialog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadFolders()
    End Sub

    Public Sub LoadFolders()
        FolderBox.DataSource = LoadDataView("select distinct folder as ID, folder as Description from dbo.Modelling_Scenarios where folder is not null union " & _
                                            "select 'New0' as ID, 'New folder...' as Description")

        FolderBox.ValueMember = "ID"
        FolderBox.DisplayMember = "Description"
    End Sub
End Class
